package com.heima.common.exception;

import com.heima.common.dtos.AppHttpCodeEnum;
import lombok.Getter;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 自定义业务异常类
 */
@Getter
public class LeadNewsException extends RuntimeException {
    //异常状态码
    private Integer status;

    public LeadNewsException(AppHttpCodeEnum appHttpCodeEnum) {
        super(appHttpCodeEnum.getErrorMessage());
        this.status = appHttpCodeEnum.getCode();
    }


    public LeadNewsException(Integer status, String message) {
        super(message);
        this.status = status;
    }
}
